<?php
// +----------------------------------------------------------------------
// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2017 http://www.thinkcmf.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 小夏 < 449134904@qq.com>
// +----------------------------------------------------------------------
namespace api\home\validate;

use think\Validate;

class AppUserValidate extends Validate
{
    protected $rule = [
        'phone' => 'require',
        'password' => 'require|length:8,16|alphaNum',
        'code' => 'require'
    ];
    protected $message = [
        'phone.require' => '请输入手机号!',
        'password.require' => '请输入您的密码!',
        'password.length'          => '密码请设置8~16个字符!',
        'password.alphaNum'          => '密码请设置字母加数字!',
        'code.require' => '请输入您的短信验证码!'
    ];

    protected $scene = [
        'loginPassword'  => [ 'phone' , 'password'],
        'loginPhone'  => [ 'phone' , 'code'],
    ];
}